//package com.whfp.coky.ble.print
//
//import android.os.Handler
//import android.os.Looper
//import android.os.Message
//import com.android.print.sdk.PrinterConstants
//
///**
// *
// *
// * created by coky on 2022/3/28
// */
//class PHandler(var listener: PrintBtController.PrintListener) : Handler(Looper.getMainLooper()){
//    override fun handleMessage(msg: Message) {
//        super.handleMessage(msg)
//        when (msg.what) {
//            PrinterConstants.Connect.FAILED -> {
//                listener.printConnFailed()
////                stopRxLodingDialog()
////                isConnect = false
////                tv_connect_status_print.setText("打印机[$pmac]连接失败")
////                tv_connect_status_print.setTextColor(
////                    ContextCompat.getColor(
////                        context,
////                        R.color.button_selector_red
////                    )
////                )
////                btn_connect_print.setText("扫码连接打印机")
//            }
//            PrinterConstants.Connect.SUCCESS -> {
//                listener.printConnSuccess()
////                stopRxLodingDialog()
////                isConnect = true
////                //保存连接的打印机MAC
////                try {
////                    CacheDiskUtils.getInstance().put(
////                        RxConstants.CACHE_MAC_PRINT, AESUtils.encryptDeviceMac(
////                            "ZXLDYJ-01$pmac"
////                        )
////                    )
////                } catch (e: GeneralSecurityException) {
////                    e.printStackTrace()
////                }
////                com.whfp.zxwl.module.drug_test.activity.MainActivity_DPJC.mPrinter =
////                    myOpertion.getPrinter()
////                tv_connect_status_print.setText("打印机[$pmac]已连接")
////                tv_connect_status_print.setTextColor(
////                    ContextCompat.getColor(
////                        context,
////                        R.color.theme_bg
////                    )
////                )
////                btn_connect_print.setText("断开打印机连接")
//            }
//            PrinterConstants.Connect.CLOSED -> {
//                listener.printConnClosed()
////                isConnect = false
////                tv_connect_status_print.setText("打印机未连接")
////                tv_connect_status_print.setTextColor(
////                    ContextCompat.getColor(
////                        context,
////                        R.color.button_selector_red
////                    )
////                )
////                btn_connect_print.setText("扫码连接打印机")
//            }
//        }
//    }
//}